<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引用vue3的源码 -->
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div class="app"></div>
    
</body>
<script>
    const app = Vue.createApp({
        data() {
            return {
                classStr:'red',
                classObj:{
                    red:true,
                    bgcolor:true
                },
                classArr:['green','bgcolor',{red:true}]
            }
        },
        //更改样式可以绑定变量也可以绑定对象或者绑定数组
        //数组里面元素也可以放对象的形式
        template:`
            <h2 :class='classObj'>jspang.com</h2>
        `
    })
    app.mount('.app')
</script>

<style>
    .red{
        color: red;
    }
    .green{
        color: green;
    }
    .bgcolor{
        background-color: orange;
    }
</style>

</html>